<%@ Page Language="c#" Inherits="PHSRAG.Insight21.Personnel.AddEditDistribution" CodeFile="AddEditDistribution.aspx.cs" %>

<%@ Register TagPrefix="cc1" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>AddEditDistribution</title>

    <script type="text/javascript" language="javascript">
		function DistributionTypeToggle(distributionType){
			if ( distributionType == 'Internal' ) 
			{  
			window.externalDistribution.style.display		='none';
			window.externalDistribution.style.visibility	='hidden';
			window.internalDistribution.style.display		='inline';
			window.internalDistribution.style.visibility	='visible';
			} 
			else
			{  
			window.internalDistribution.style.display		='none';
			window.internalDistribution.style.visibility	='hidden';
			window.externalDistribution.style.display		='inline';
			window.externalDistribution.style.visibility	='visible';
			} 
			return false; 
		}
    </script>

    <link href="../Insight21.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <form method="post" id="AddEditDistributionForm" runat="server">
        <table class="PopupTitle" width="100%">
            <tr>
                <td>
                    &nbsp;<asp:Label ID="txtTitle" runat="server" />
                </td>
            </tr>
        </table>
        <div>
            <table class="view">
                <tr>
                    <td>
                        <cc1:Annunciator ID="annunciator" runat="server"></cc1:Annunciator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:ValidationSummary ID="validations" runat="server" HeaderText="The following fields contain problems:" />
                    </td>
                </tr>
                <tr>
                    <td style="width:10%">
                        Type:</td>
                    <td style="width:10%" align="left">
                        <asp:RadioButton ID="internalSelect" runat="server" GroupName="DistributionType"
                            Text="Internal" />
                    </td>
                    <td style="width:30%">
                        <asp:RadioButton ID="externalSelect" runat="server" GroupName="DistributionType"
                            Text="External" />
                    </td>
                </tr>
            </table>
            <table class="view">
                <tr>
                    <td valign="top" style="width:210px" colspan="4">
                        <div id="internalDistribution" runat="server">
                            <table class="view">
                                <tr>
                                    <td>
                                        Fund #:</td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="fundNumber" runat="server" CssClass="FlatTextBox" Width="100" /></td>
                                </tr>
                            </table>
                        </div>
                        <div id="externalDistribution" runat="server">
                            <table class="view">
                                <tr>
                                    <td>
                                        Fund Source:</td>
                                    <td>
                                        Title:</td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:DropDownList ID="fundSource" runat="server" CssClass="FlatDropDown" Width="100" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="fundTitle" runat="server" CssClass="FlatTextBox" Width="90" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                    <td colspan="2">
                    </td>
                </tr>
                <tr>
                    <td style="width:110px">
                        Annual Rate:</td>
                    <td style="width:100px">
                        % Effort:</td>
                    <td>
                        Start Date:</td>
                    <td>
                        End Date:</td>
                </tr>
                <tr>
                    <td>
                        $<asp:TextBox ID="annualRate" runat="server" CssClass="FlatTextBox" Width="80" />
                        <asp:RequiredFieldValidator ID="annualRateRequired" runat="server" ControlToValidate="annualRate"
                            Display="Static" ErrorMessage="Annual Rate is required">*</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="annualRateCompare" runat="server" ControlToValidate="annualRate"
                            Operator="DataTypeCheck" Type="Currency" Display="Static" ErrorMessage="Invalid Annual Rate">*</asp:CompareValidator>
                    </td>
                    <td>
                        <asp:TextBox ID="percentEffort" runat="server" CssClass="FlatTextBox" Width="70" />
                        <asp:RequiredFieldValidator ID="percentEffortRequired" runat="server" ControlToValidate="percentEffort"
                            Display="Static" ErrorMessage="Percent Effort is required">*</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="percentEffortCompare" runat="server" ControlToValidate="percentEffort"
                            Operator="DataTypeCheck" Type="Double" Display="Static" ErrorMessage="Invalid Percent Effort">*</asp:CompareValidator>
                        <asp:RangeValidator ID="percentEffortRange" runat="server" ControlToValidate="percentEffort"
                            MaximumValue="100" MinimumValue="0" Type="Double" ErrorMessage="Percent Effort must be between 0 and 100">*</asp:RangeValidator>
                    </td>
                    <td>
                        <cc1:Calendar ID="startDate" CssClass="ReadOnlyText" Width="140px" Height="10" EndYear="2050"
                            DropDownListNavigation="true" BeginYear="1990" ToolTip="Select distribution start date"
                            runat="server"></cc1:Calendar>
                    </td>
                    <td>
                        <cc1:Calendar ID="endDate" CssClass="ReadOnlyText" Width="140px" Height="10" EndYear="2050"
                            DropDownListNavigation="true" BeginYear="1990" ToolTip="Select distribution end date"
                            runat="server"></cc1:Calendar>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    </td>
                    <td>
                        Comments:</td>
                </tr>
                <tr>
                    <td colspan="2">
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="comments" runat="server" TextMode="MultiLine" Width="200" Rows="3" />
                    </td>
                </tr>
                <tr>
                    <td style="width:8px">
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    </td>
                    <td style="vertical-align: baseline;width:10%">
                        <asp:Button ID="cancelSaveOperation" runat="server" Text="Cancel" CssClass="FlatButton"
                            Width="50" />
                    </td>
                    <td style="vertical-align: baseline; text-align: left;width:30%">
                        <asp:Button ID="saveDistribution" runat="server" Text="Save" CssClass="FlatButton"
                            CausesValidation="True" Width="50" OnClick="OnSave" />
                    </td>
                </tr>
            </table>
        </div>
        <table class="PopupFooter" width="100%">
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </form>
</body>
</html>
